
<template>
  <div>
      我是父组件===={{s}}
         <input  type="button" @click="say()" value="btn"/>
    <hr/>
    <son :ff='ff' @sshandle="sshandle"></son>
  </div>
</template>

<script>
import  son   from  './components/son.vue'
import {ref,onMounted,provide} from  'vue'  
export default {
  provide:{
    v2:'我是v2==msg'
  },
  components:{
    son
  },
  setup () {
    const  ff=ref('')
    const say = () => {
      ff.value='这是father传给子组件的'
    }

    

    const s=ref('')

    const sshandle=(msg)=>{
      console.log(msg,111);
      s.value=msg
    }
    const root=ref('我是根组件')
    // provide('键','值')
    provide('rootMsg',root)
   
    return {ff,say,sshandle,s}
  }
}
</script>

<style lang="scss" scoped>

</style>